{% extends "layouts/base.html" %}

{% block title %} UI Tables {% endblock %} 

<!-- Specific CSS goes HERE -->
{% block stylesheets %}{% endblock stylesheets %}

{% block content %}

<div class="pcoded-content">
    <div class="pcoded-inner-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
            <div class="page-block">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="page-header-title">
                            <h5 class="m-b-10">Bootstrap Basic Tables</h5>
                        </div>
                        <ul class="breadcrumb">
                            <li class="breadcrumb-item"><a href="/"><i class="feather icon-home"></i></a></li>
                            <li class="breadcrumb-item"><a href="">Tables</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <!-- [ breadcrumb ] end -->
        <div class="main-body">
            <div class="page-wrapper">
                <!-- [ Main Content ] start -->
                <div class="row">

                    <!-- [ Hover-table ] start -->
                    <div class="col-xl-12">
                        <div class="card">
                            <div class="card-header">
                                <h5>Rentals</h5>
                                <span class="d-block m-t-5">use class <code>table-hover</code> inside table element</span>
                            </div>
                            
                            <div class="card-block table-border-style">
                                <div class="table-responsive">
                                    <table class="table table-hover">
                                        <thead>
                                            <th>rid</th>
                                            <th>客户姓名</th>
                                            <th>包包类型</th>
                                            <th>租借日期</th>
                                            <th>应还日期</th>
                                            <th>是否购买保险</th>
                                        </thead>
                                        <tbody>
                                        {% for obj in objs %}
                                            <tr>
                                                <td>{{ obj.rid }}</td>
                                                <td>{{ obj.cid.first_name }} {{obj.cid.last_name}}</td>
                                                <td>{{ obj.bid.btype }} </td>
                                                <td>{{ obj.date_rented }} </td>
                                                <td>{{ obj.date_returned }} </td>
                                                {% if obj.optional_insurance == 1 %}
                                                <td> <i class="fas fa-circle text-c-green f-10 m-r-15"></i>是 </td>
                                                {% else %}
                                                <td> <i class="fas fa-circle text-c-red f-10 m-r-15"></i> 否 </td>
                                                {% endif %}
                                            </tr>
                                        {% endfor %}
                                        </tbody> 
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- [ Hover-table ] end -->

                </div>
                <!-- [ Main Content ] end -->
            </div>
        </div>
    </div>
</div>

{% endblock content %}

<!-- Specific Page JS goes HERE  -->
{% block javascripts %}{% endblock javascripts %}
